package com.haliyoo.adhere.widget;

import com.haliyoo.adhere.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ProgressBarView extends LinearLayout{

	private LinearLayout llCommon = null;
	private TextView tvCommon = null;
	
	public ProgressBarView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		((LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(
				R.layout.progressbar_view, this);
		
		/**
		 * 布局
		 */
		llCommon = (LinearLayout) findViewById(R.id.LINEAR_LAYOUT_COMMON);
		llCommon.setVisibility(View.GONE);
		
		/**
		 * 提示
		 */
		tvCommon = (TextView) findViewById(R.id.TEXT_VIEW_COMMON);
	}

	/**
	 * 显示进度条
	 * @param strTip 进度条文本
	 */
	public void show(String strTip) {
		tvCommon.setText(strTip);
		llCommon.setVisibility(View.VISIBLE);
	}
	
	/**
	 * 隐藏进度条
	 */
	public void hide() {
		llCommon.setVisibility(View.GONE);
	}
}
